package com.sjb.sixteen_journey_backend.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sjb.sixteen_journey_backend.entity.vo.UserBaseMsgVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 机票晒单表
 * </p>
 *
 * @author jcz
 * @since 2024-07-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("air_ticket")
public class AirTicket implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 机票晒单表id
     */
    @TableId(value = "air_ticket_id", type = IdType.AUTO)
    private Integer airTicketId;

    /**
     * 用户id
     */
    @TableField("user_id")
    @JsonIgnore
    private Integer userId;

    @TableField(exist = false)
    private UserBaseMsgVo user;

    @TableField(exist = false)
    private Boolean is_followedByUser;

    /**
     * 图片地址
     */
    @TableField("path")
    @JsonIgnore
    private String path;

    @TableField(exist = false)
    private List<String> images;

    /**
     * 订单总价
     */
    @TableField("total_money")
    private Integer totalMoney;

    /**
     * 订单包含人数
     */
    @TableField("number")
    private Integer number;

    /**
     * 0单程；1往返
     */
    @TableField("air_way")
    private Integer airWay;

    /**
     * 出发城市
     */
    @TableField("origin_city")
    private String originCity;

    /**
     * 到达城市
     */
    @TableField("arrive_city")
    private String arriveCity;

    /**
     * 航空公司
     */
    @TableField("airline")
    private String airline;

    /**
     * 舱位（0经济舱/1头等商务舱）
     */
    @TableField("shipping_space")
    private Boolean shippingSpace;

    /**
     * 购买渠道
     */
    @TableField("buy_way")
    private String buyWay;

    /**
     * 购买时间
     */
    @TableField("buy_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date buyTime;

    /**
     * 飞行时间
     */
    @TableField("air_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date airTime;

    /**
     * 购买心得
     */
    @TableField("experience")
    private String experience;

    /**
     * 发布时间
     */
    @TableField(value = "postdate",fill = FieldFill.INSERT)
    private LocalDateTime postdate;

    /**
     * 被赞
     */
    @TableField("collected")
    private Integer collected;

    /**
     * 被喜欢
     */
    @TableField("be_liked")
    private Integer beLiked;

    /**
     * 被评论的数量
     */
    @TableField(exist = false)
    private Long commentCount;

    /**
     * 浏览量,浏览量到达2500为精品晒单
     */
    @TableField("pv")
    private Integer pv;

    /**
     * 晒单表类型 1
     */
    @TableField("status")
    private Integer status;

    /**
     * 共性id
     */
    @TableField(exist = false)
    private Commonness commonness;



}
